const mongoose = require('mongoose')

const replySchema = new mongoose.Schema({
    author:{
        type: mongoose.Schema.Types.ObjectId,
        ref: 'Normal',
        default:'61ebac6d0bb1ed1e78ca85c6'
    },
    content: {
        type: String,
        required: [true, '评论内容不能为空']
    },
    time: {
        type: Date,
        default: new Date()
    },
    reply:{
        type: mongoose.Schema.Types.ObjectId,
        ref: 'Normal'
    },
    status:{
        type:Boolean,
        default:false
    }

})

// 3.根据规则创建集合
const Reply = mongoose.model('Reply', replySchema);


// 4.将集合做为模块成员进行导出
module.exports = Reply
